<?php

/***
 * Class LoginModel
 * 判断后台用户是否登陆
 */
class LoginModel extends PdoModel {

    function __construct(){
        parent::__construct();
    }

    #判断用户是否登录
    public function is_or_not_logined(){
        #获取当前浏览器session缓存的后台用户信息
        $admin_uid = $this->get_current_adminuser();
        if(!empty($admin_uid)){
            return $admin_uid;
        }
        return array();
    }


    #获得当前浏览器后台登陆用户信息
    function get_current_adminuser(){
        $login_session = Yaf_Registry::get('config')->get('product.admin_login');  //获取缓存名
        $admin_uid = Yaf_Session::getInstance()->get($login_session);  //查询数据
        return $admin_uid;
    }




    #设置信息
    function set_popup_message($message){
        Yaf_Session::getInstance()->set('popup_message',$message);
    }



}